/**
	* @author 		Yuri Visser
	* @Created 		
	* @LastUpdated	
	* @Comments		
	* @Notes 		
	* 
**/

package com.theredspace.as3frameworks.puremvc.controller {
	
	import com.theredspace.as3frameworks.puremvc.ApplicationFacade;
	import com.theredspace.as3frameworks.puremvc.model.CreatureAssetsProxy;
	import com.theredspace.as3frameworks.puremvc.view.components.Zoop;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class AddCreatureCommand extends SimpleCommand {
		
		override public function execute(note:INotification):void {
			var creatureType:int = note.getBody() as int;
			
			var tmpCreatureAssetsProxy:CreatureAssetsProxy = facade.retrieveProxy(CreatureAssetsProxy.NAME) as CreatureAssetsProxy;
			
			var creature:Zoop;
			
			if(creatureType == 1) {
				creature = new Zoop(tmpCreatureAssetsProxy.creature1, 1);
			}
			else if(creatureType == 2) {
				creature = new Zoop(tmpCreatureAssetsProxy.creature2, 2);
			}
			else if(creatureType == 3){
				creature = new Zoop(tmpCreatureAssetsProxy.creature3, 3);
			}
			
			creature ? sendNotification(ApplicationFacade.ADD_CREATURE_TO_LAIR, creature) : null;
		}
		
	/************************************************************************/   
	}  //END CLASS
 
/****************************************************************************/  
}  //END PACKAGE